var fs=require("fs");

/*异步写入文件*/
/*fs.writeFile("./write.txt","我要写入文件",function (err) {
    if (err){
        throw  err;
    }
    console.log("写入成功");
});
console.log("程序执行完毕");*/
/*异步写入文件*/

/*同步写入文件*/
 fs.writeFileSync("./write1.txt","我要写入文件");
console.log("写入成功");
/*同步写入文件*/